ImagXpress 13 for ActiveX - User Guide > How To > Use the New Multi-Page TIFF Edit API > Delete Multiple Pages |
The DeletePage method deletes a single page at a time. The DeletePages method allows the developer to specify the number of pages to delete.
The DeletePage method looks like this:
VB Example |
Copy Code
|
---|---|
Sub DeletePage( FileName As String, PageNbr As Long ) |
The DeletePages method looks like this:
VB Example |
Copy Code
|
---|---|
Sub DeletePage( FileName As String, PageNbr As Long, NumPages As Long ) |
Using DeletePage to delete the first 3 pages in a multipage TIFF document requires code similar to this:
Copy Code
|
|
---|---|
Dim i As Integer For i = 1 To 3 ImagXpress1.DeletePage filename, 1 Next |
Using DeletePages, the previous example is done like this:
Copy Code
|
|
---|---|
ImagXpress1.DeletePages filename, 1, 3 |
Using DeletePage to delete the last 3 pages in a multipage TIFF document requires code similar to this:
Copy Code
|
|
---|---|
Dim numberOfPagesInDocument As Long Dim pageToDelete As Long Dim i As Integer numberOfPagesInDocument = ImagXpress1.NumPages(filename) pageToDelete = numberOfPagesInDocument - 2 For i = 1 To 3 ImagXpress1.DeletePage filename, pageToDelete Next |
Using DeletePages, the previous example is done like this:
Copy Code
|
|
---|---|
Dim numberOfPagesInDocument As Long Dim startPageToDelete As Long numberOfPagesInDocument = ImagXpress1.NumPages(filename); startPageToDelete = numberOfPagesInDocument - 2; ImagXpress1.DeletePages filename, startPageToDelete, 3 |